package com.yanchi.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author yanchi
 * @date 2022/1/19 20:39
 */
@RestController
@RefreshScope   // 可以发送post请求刷新配置中心的配置,作用域在本类
public class DemoController {

    @Value("${name}")
    private String name;

    @GetMapping("demo")
    public String demo(){

        return "demo ok " + name;
    }

}
